package cn.sunxyz.modules.memory;

import java.util.Collection;
import java.util.Date;

/**
 * Created by yangrd on 2017/5/11.
 */
public class NodeMangerAdapter<V> implements NodeLinkInfoManger<V>, NodeFactory<V> {

    private NodeFactory<V> nodeFactory = DefaultNodeFactory.getInstance();

    private NodeLinkInfoManger<V> nodeLinkInfoManger = DefaultNodeLinkInfoManger.getInstance();

    @Override
    public void addNode(V value) {
        nodeFactory.addNode(value);
    }

    @Override
    public void clearNode(V value) {
        nodeFactory.clearNode(value);
    }

    @Override
    public void linkNode(V value, V... friends) {
        nodeFactory.linkNode(value, friends);
    }

    @Override
    public Node<V> getNode(V value) {
        return nodeFactory.getNode(value);
    }

    @Override
    public Collection<Node<V>> getNodeFriends(V value) {
        return nodeFactory.getNodeFriends(value);
    }

    @Override
    public void addRecord(V value, V... friends) {
        nodeLinkInfoManger.addRecord(value, friends);
    }

    @Override
    public Collection<Date> getUseDate(V value, V friend) {
        return nodeLinkInfoManger.getUseDate(value, friend);
    }

    @Override
    public Integer usageCount(V value, V friend) {
        return nodeLinkInfoManger.usageCount(value, friend);
    }
}
